From: Jasper St. Pierre Date: Mon, 16 Mar 2015 17:54:37 +0000 (-0700) Subject: loginDialog: Better handle setting the active session X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1467 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=681861c8c76cb96ab2a6199df1153202a5c9e292;p=gnome-shell.git loginDialog: Better handle setting the active session We currently use the setActiveSession method to both mark a menu item as selected, and also tell gdm about the current session the user selected. Since gdm is ultimately in charge of the state, we should decouple this and simply ask gdm to set the session, and have the menu item reflect what gdm thinks is the current session. This prevents state getting mismatched and oscillations from happening, where we get in a loop of constantly telling gdm what the session is. https://bugzilla.gnome.org/show_bug.cgi?id=740142 --- diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 6b90bb0b5..c269cb30c 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -323,13 +323,15 @@ const SessionMenuButton = new Lang.Class({ } }, - setActiveSession: function(sessionId) { + activeSessionChanged: function(sessionId) { if (sessionId == this._activeSessionId) return; this._activeSessionId = sessionId; this._updateOrnament(); + }, + setActiveSession: function(sessionId) { this.emit('session-activated', this._activeSessionId); }, @@ -788,7 +790,7 @@ const LoginDialog = new Lang.Class({ }, _onDefaultSessionChanged: function(client, sessionId) { - this._sessionMenuButton.setActiveSession(sessionId); + this._sessionMenuButton.activeSessionChanged(sessionId); }, _shouldShowSessionMenuButton: function() {